//
//  LYLeftViewController.m
//  LYWeiBo
//
//  Created by 老岳 on 13-9-27.
//  Copyright (c) 2013年 LY. All rights reserved.
//

#import "LYLeftViewController.h"
#import "LeftSideCell.h"
#import <QuartzCore/QuartzCore.h>

@interface LYLeftViewController ()

@end

@implementation LYLeftViewController

- (void)dealloc
{
    self.groupTableView = nil;
    
    self.groupArr = nil;
    
    [super dealloc];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.navigationController.navigationBarHidden = YES;
     
    //
    self.groupTableView = [[[UITableView alloc] initWithFrame:CGRectMake(0, 0, LeftVC_Width, Screen_Frame_height-69) style:UITableViewStylePlain] autorelease];
    self.groupTableView.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
    self.groupTableView.showsVerticalScrollIndicator = NO;
    self.groupTableView.separatorColor = [UIColor clearColor];
    self.groupTableView.delegate = self;
    self.groupTableView.dataSource = self;
    [self.view addSubview:self.groupTableView];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 12;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    LeftSideCell *cell =[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[LeftSideCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        [cell setSelectionStyle:UITableViewCellSelectionStyleGray];
    }
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return Header_Height;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, LeftVC_Width, Header_Height)] autorelease];
    view.backgroundColor = [UIColor clearColor];
    
    //头像
    UIImageView *headerImageView = [[[UIImageView alloc] initWithFrame:CGRectMake(40, 20, 80, 80)] autorelease];
    headerImageView.layer.cornerRadius = 40;
    headerImageView.backgroundColor = [UIColor whiteColor];
    [view addSubview:headerImageView];
    
    //用户名
    UILabel *userNameLabel = [[[UILabel alloc] initWithFrame:CGRectMake(5, 100, 150, 40)] autorelease];
    userNameLabel.text = @"用户名yonghuming";
    userNameLabel.textColor = [UIColor whiteColor];
    userNameLabel.backgroundColor = [UIColor clearColor];
    userNameLabel.font = [UIFont systemFontOfSize:15];
    userNameLabel.textAlignment = NSTextAlignmentCenter;
    [view addSubview:userNameLabel];
    
    return view;
}

@end



